#include "datamodel.h"
#include <QSqlDatabase>

DataModel::DataModel(QObject *parent, QSqlDatabase database) :
    QSqlTableModel(parent), m_database(database)
{
    setTable("download");
    setEditStrategy(QSqlTableModel::OnManualSubmit);

    select();
    setHeaderData(0, Qt::Horizontal, tr("ID"));
    setHeaderData(1, Qt::Horizontal, tr("URL"));
    setHeaderData(2, Qt::Horizontal, tr("Local"));
    setHeaderData(3, Qt::Horizontal, tr("Progress"));
}
